package com.itheima.xxl.demo;

import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class DemoXxlJob {
    /**
     * @throws Exception
     * @XxlJob("demoJobHandler") : 该注解用来定义任务处理器, 并且设置该任务的别名
     */
    @XxlJob("clean")
    public void clean() throws Exception {

        System.out.println(new Date() + " : 任务开始执行...");
    }
}